package com.highspeed.bdk.bean.entity.logic;

import com.bianmaba.spring.data.jpa.domain.annotations.QueryCacheable;
import com.highspeed.bdk.bean.base.IncrementEntity;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by chenjiabin on 2018/3/23.
 */
@Entity
@DynamicUpdate(true)
@DynamicInsert(true)
@QueryCacheable
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class LogicLink extends IncrementEntity {
    @Column(nullable = false, length = 32)
    private String name;


    @Column(length = 16)
    private String leftPort;

    @Column(length = 16)
    private String rightPort;

    @ManyToOne(optional = false)
    @JoinColumn(name = "leftApp_Id", nullable = false)
    private App leftApp;

    @ManyToOne(optional = false)
    @JoinColumn(name = "rightApp_Id", nullable = false)
    private App rightApp;

    /**
     * 逻辑拓扑
     */

    @ManyToOne
    @JoinColumn(name = "logicTopology_id")
    private LogicTopology logicTopology;

    private String logicalLinkType;
    private String logicalLinkStatus;
    private String logicalLinkSync;
    private String direction;
    private String portMode;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLeftPort() {
        return leftPort;
    }

    public void setLeftPort(String leftPort) {
        this.leftPort = leftPort;
    }

    public String getRightPort() {
        return rightPort;
    }

    public void setRightPort(String rightPort) {
        this.rightPort = rightPort;
    }

    public App getLeftApp() {
        return leftApp;
    }

    public void setLeftApp(App leftApp) {
        this.leftApp = leftApp;
    }

    public App getRightApp() {
        return rightApp;
    }

    public void setRightApp(App rightApp) {
        this.rightApp = rightApp;
    }

    public LogicTopology getLogicTopology() {
        return logicTopology;
    }

    public void setLogicTopology(LogicTopology logicTopology) {
        this.logicTopology = logicTopology;
    }

    public String getLogicalLinkStatus() {
        return logicalLinkStatus;
    }

    public void setLogicalLinkStatus(String logicalLinkStatus) {
        this.logicalLinkStatus = logicalLinkStatus;
    }

    public String getLogicalLinkSync() {
        return logicalLinkSync;
    }

    public void setLogicalLinkSync(String logicalLinkSync) {
        this.logicalLinkSync = logicalLinkSync;
    }

    public String getDirection() {
        return direction;
    }

    public void setDirection(String direction) {
        this.direction = direction;
    }

    public String getPortMode() {
        return portMode;
    }

    public void setPortMode(String portMode) {
        this.portMode = portMode;
    }

    public String getLogicalLinkType() {
        return logicalLinkType;
    }

    public void setLogicalLinkType(String logicalLinkType) {
        this.logicalLinkType = logicalLinkType;
    }
}
